/**
 * @Author: Bobby
 * @Date: 2022-02-15 13:14:17
 * @LastEditTime: 2022-03-09 14:22:38
 * @LastEditors: Bobby
 * @Description:
 * @FilePath: \wms-v2\src\ve\common\components\baseComs\wms\uiSelectLayerNewORDER.js
 * @CIMC-V2
 */
import { exValidateSelect, exInput, exSizeSelect, exSwitch, exRequestData } from '@ve/common/components/extension'
import { constantTip } from '@ve/common/components/extension/tip'
export default {
  VERSION: '20220411',
  type: 'uiSelectLayerNewORDER',
  name: '单据选择',
  icon: 'cursor-line',
  svg: 'danju',
  //数据别名
  // dataName: 'uiSelectLayerNew_data',
  //数据集合 表单 列表等等
  data: {
    formData: {
      '#LIMIT#': 1,
      '#PAGE_SIZE#': 5,
    },
    requestData: {
      count: 0,
      data: [],
    },
  },
  extension: {
    model: exInput('Model', 'ORDER_TYPE', '向数据库提交的字段'),
    fieldKey: exInput('TEXT字段', 'ORDER_TYPE', '页面展示的字段'),
    fieldValue: exInput('Model对照', '', '弹框内字段绑定,为空则以model配置的字段为准'),
    textValue: exInput('TEXT对照', '', '弹框内字段绑定,为空则以TEXT配置的字段为准'),
    getOutKey: exInput('关联字段', '', '表单关联带出的字段，多个以英文逗号好隔开'),
    rule: exValidateSelect('', {}, []),
    label: exInput('标签', '单据下拉'),
    size: exSizeSelect('尺寸', 'mini'),
    width: exInput('宽度', 'auto', '填写数字:单位px,auto:自动宽度'),
    labelWidth: exInput('label宽度', 'auto', '填写数字:单位px,auto:自动宽度'),
    defaultValue: exInput('默认值', '', constantTip()),
    disabled: exSwitch('禁用', false),
    readonly: exSwitch('只读', true),
    hidden: exSwitch('隐藏', false),
    api: exInput('Api接口', '/wms/wms-web'),
    method: exInput('Method', 'wms.order.type.components.select'),
    getDataKey: exInput('获取数据Key', 'wms.order.type.components.select'),
    requestData: exRequestData('参数', [
      { key: '#LIMIT#', value: 1 },
      { key: '#PAGE_SIZE#', value: 50 },
      { key: 'ORDER_BUSINESS_TYPE', value: 'RCV' },
    ]),
    tableColumns: {
      type: 'exTableColumns',
      name: '表头配置',
      value: [
        { _type: 'checkbox', title: '全选', type: 'checkbox', width: 80 },
        { _type: 'seq', title: '序号', type: 'seq', width: 80 },
        {
          _type: 'field',
          field: 'ORDER_TYPE',
          title: '单据类型',
          sortable: false,
          fixed: '',
          width: '',
          editRender: {},
          slots: { edit: 'name_edit' },
          openSearch: true,
          searchConfig: {},
        },
        {
          _type: 'field',
          field: 'ORDER_TYPEDESCRC',
          title: '单据类型中文描述',
          sortable: false,
          fixed: '',
          width: '200',
          editRender: {},
          slots: { edit: 'name_edit' },
          openSearch: true,
          searchConfig: {},
        },
        {
          _type: 'field',
          field: 'ORDER_TYPEDESCRE',
          title: '单据类型英文描述',
          sortable: false,
          fixed: '',
          width: '200',
          editRender: {},
          slots: { edit: 'name_edit' },
        },
      ],
    },
    pageSizes: {
      type: 'exPageSizes',
      name: '分页配置',
      value: [50, 100, 200],
    },
    pageSize: exInput('默认分页', 50),
    ignoreClearValue: exSwitch('忽略清空', false, '开启后清空表单会保留默认值'),
    enterSelect: {
      type: 'exModuleSelect',
      name: '回车选中',
      value: [],
      hasCheckbox: false,
      treeData: '$getPageModules',
    },
    hiddenBottomBtn: exSwitch('隐藏底部', false, '是否在单选模式下隐藏底部确认按钮'),
  },
  //交互
  interaction: [],
  //条件、逻辑指令
  logicInstruction: [],
  //数据源绑定
  dataSourceBind: {
    sourceId: {
      type: 'exGetDataSource',
      name: '组件ID',
      value: {
        type: 1,
        source: [],
      },
    },
    // dataKey: exInput('数据Key', ''),
    getDataKey: exInput('数据Key', '', '获取数据的 key 的集合，多个 key 用 “,” 分隔，如需获取全部数据则不填写'),
    hasParam: exSwitch('当参数用', false, '默认当数据使用,开启当参数使用'),
  },
}
